package com.hongkang.egc;

import com.hongkang.utils.Utils;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;


public class MainTableActivity extends BaseActivity{
	/**
	 * image buttons
	 */
	ImageView mStartECG;
	ImageView mPatientInfo;
	ImageView mEcgRecord;
	ImageView mSetting;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		// init table
		setContentView(R.layout.main_table);
		//init UI
		mStartECG = (ImageView)findViewById(R.id.main_btn_start_read);
		mStartECG.setOnClickListener(mOnStartEcgClick);
		mPatientInfo = (ImageView)findViewById(R.id.main_btn_patient_info);
		mPatientInfo.setOnClickListener(mPatientActivityClick);
		mEcgRecord = (ImageView)findViewById(R.id.main_btn_pic_record);
		mEcgRecord.setOnClickListener(mOnEcgRecordClick);
		mSetting = (ImageView)findViewById(R.id.main_btn_setting);
		mSetting.setOnClickListener(mSettingActivityClick);
	}
	
	/**
	 * start ecg
	 */
	OnClickListener mOnStartEcgClick = new OnClickListener() {
		
		@Override
		public void onClick(View v) {
			//Utils.startECGActivity(MainTableActivity.this);
			Utils.viewWalkReadingEcgScopeActivity(MainTableActivity.this, R.raw.signal4);
		}
	};
	
	/**
	 * ecg record
	 */
	OnClickListener mOnEcgRecordClick = new OnClickListener() {	
		@Override
		public void onClick(View v) {
			Utils.ecgRecordActivity(MainTableActivity.this);
		}
	};
	
	/**
	 * patient info
	 */
	OnClickListener mPatientActivityClick = new OnClickListener() {
		
		@Override
		public void onClick(View v) {
			Utils.startPatientInfoActivity(MainTableActivity.this);		
		}
	};
	
	/**
	 * setting
	 */
	OnClickListener mSettingActivityClick = new OnClickListener() {
		
		@Override
		public void onClick(View v) {
			Utils.startSettingActivity(MainTableActivity.this);
		}
	};
}
